# CMake 最低版本要求
message(STATUS "CMake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.14)

# 设置代码根路径
set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS "ROOT_DIR is: ${ROOT_DIR}")

# 设置安装路径
set(CMAKE_INSTALL_PREFIX "${ROOT_DIR}/install" CACHE PATH "Install path" FORCE)
message(STATUS "Install path: ${CMAKE_INSTALL_PREFIX}")

# 如果安装路径不存在则创建
file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}")

# 设置C++标准版本
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 打印C++标准版本
message(STATUS "CMAKE_CXX_STANDARD is: ${CMAKE_CXX_STANDARD}")

add_subdirectory(math)
add_subdirectory(others)
add_subdirectory(CppBasic)
add_subdirectory(Array)